package 面向对象.day05;

import javax.swing.*;

/**
 * @author 王敬仟
 * Battleship 战舰类
 * SeaObject 继承父类
 */
public class Battleship extends SeaObject {
    private int life;//战舰的命
    /*添加构造方法*/
    public Battleship(){
        super(66,26,270,124,20);
        life = 5;//设置命为5
    }
    /*战舰的移动方法*/
    public void move(){

    }
    /*设置图片*/
    public ImageIcon getImage(){
        //返回战舰图片
        return Iamges.battleship;
    }
    /*炸弹入场*/
    public Bomb shoot(){
        return new Bomb(this.x,this.y);
    }
    /*战舰向左移动*/
    public void moveLeft(){
        x -= speed;
    }
    /*战舰向右移动*/
    public void moveRight(){
        x += speed;
    }
}
